package com.leeon.overload;

import com.leeon.interfacedefault.InterfaceDefaultDemo;
import com.leeon.override.OverrideSub;

/**
 *
 * 限定符大小
 * public>protected>default>private
 *
 */
public class OverLoadDemo {

    public void print(int a) {
        System.out.println("int a = " + a);
    }

    public void print(float a) {
        System.out.println("float a = " + a);
    }

    public void print(double a) {
        System.out.println("double a = " + a);
    }

    public void print(long a) {
        System.out.println("long a = " + a);
    }

    public static void main(String[] args) {
        OverLoadDemo demo = new OverLoadDemo();
        demo.print(1);
        demo.print(1L);
        demo.print('a');
        demo.print(1f);
        demo.print(1d);

        InterfaceDefaultDemo defaultDemo = new InterfaceDefaultDemo() {
            @Override
            public double calculate(int a) {
                return 0;
            }
        };

        System.out.println("value = " + defaultDemo.sqrt(100));

    }


}
